#include "Face.h"


Face::Face(int newX,int newY,int newZ,GLUquadricObj *newP, GLint texture_id):Shape(texture_id)
{
	this->x = newX;
	this->y = newY;
	this->z = newZ;
	this->p = newP;
	this->HIP_BASE_RADIUS = 0.8;
	this->HIP_TOP_RADIUS = 0.2;
	bDrink = false;
}
void Face::Move()
{
	this->bDrink = !this->bDrink;
}
void Face::DrawHip()
{
	if(!this->bDrink)
	{

		glPushMatrix();
		 glColor3f(1, 0.6470, 0);
	glTranslatef(this->x,this->y,this->z);
		gluSphere(p,this->HIP_BASE_RADIUS,25,5);
		//glRotatef(-90, 0,1,-0.2);
		glRotatef(this->Anglecord.angle, this->Anglecord.xAngle,this->Anglecord.yAngle,this->Anglecord.zAngle);
		gluCylinder(p,this->HIP_BASE_RADIUS,this->HIP_TOP_RADIUS,3,5,5);
		glRotatef(90,0,1,1);
		gluCylinder(p,0.1,0,3,5,5);
		glRotatef(90,0,1,1);
		gluCylinder(p,0.1,0,3,5,5);
		glutPostRedisplay();
		glPopMatrix();
	}
	else
	{
		glPushMatrix();
		 glColor3f(1, 0.6470, 0);
		glTranslatef(this->x-7,this->y-14,this->z);
		gluSphere(p,this->HIP_BASE_RADIUS,25,5);
		glRotatef(this->Anglecord.angle, this->Anglecord.xAngle,this->Anglecord.yAngle,this->Anglecord.zAngle);
		gluCylinder(p,this->HIP_BASE_RADIUS,this->HIP_TOP_RADIUS,3,5,5);
		glRotatef(90,0,1,1);
		gluCylinder(p,0.1,0,3,5,5);
		glRotatef(90,0,1,1);
		gluCylinder(p,0.1,0,3,5,5);
		glutPostRedisplay();
		glPopMatrix();
	
	}
}

Face::~Face(void)
{
}
